package net.csdn.business.common.domain.vo;

import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.csdn.business.common.constant.CommonConstants;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author likun
 * @date 2022/6/8 13:46
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class CommentVo implements Serializable {
    /**
     * 对应 Note.java#objectId
     */
    private String commentId;
    private String targetId;
    private Long projectId;
    private String uid;
    /**
     * {@link net.csdn.business.common.enums.UserTypeEnum}
     */
    private Integer userType;
    private UserVo authorInfo;
    private String description;
    private String content;
    /**
     * MD 内容（编辑的时候需要, 评论详情）
     */
    private String mdContent;
    private String parentId;
    private String replyUser;
    private UserVo replyUserInfo;
    private String bizNo;
    private String ip;
    /**
     * {@link net.csdn.business.common.domain.issue.IssueActionEventEnum#code}
     */
    private Integer type;
    private Long status;
    private Long childCount;
    @JsonFormat(pattern = CommonConstants.DEFAULT_PATTERN, timezone = CommonConstants.DEFAULT_TIMEZONE)
    private Date createdDate;

    @JsonFormat(pattern = CommonConstants.DEFAULT_PATTERN, timezone = CommonConstants.DEFAULT_TIMEZONE)
    private Date modifyDate;

    private List<String> childIds;

    /**
     * 子评论
     */
    private List<CommentVo> childComments;

    private List<UserRole> userRoles;

    /**
     * 审核状态 {@link net.csdn.business.common.enums.AuditEnum.AuditStatusEnum}
     */
    private Integer auditStatus;

    private JSONObject ext;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class UserRole {
        private String name;
    }
}